<?php
require_once('top.php');
require_once('pasmy/dbwaarden.php');
$mysql_id = mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($db, $mysql_id);
fout($mysql_id);
if(isset($_POST["doen"])) {
	//postwaarden();
	$plek = $_POST["plaats"];
	$zips = $_POST["zip"];
	$kms = $_POST["km"];
	$idnr = $_POST["nr"];
	$dtb = $_POST["bank"];
	
	$sql = "update $dtb set km = '$kms',plaats = '$plek',zip = '$zips' where id = $idnr";
	//echo "sql = $sql";	
	$res = mysql_query($sql, $mysql_id);
	fout($mysql_id);
	//mysql_free_result($res);
	
	
	
	
}
else {	
	
$dtb = $_GET["zone"];
//echo "dtb = $dtb<br>";
$plekje = $_GET["stad"];
//echo "plekje = $plekje<br>";
$sql = "select * from $dtb where plaats = '$plekje'"; 

if($dtb == "delkm") { $urls = 'deslaux2.php';}
if($dtb == "marquettekm") { $urls = 'marquet.php';}
if($dtb == "aquakm") { $urls = 'aquaclean.php';}

$res = mysql_query($sql, $mysql_id);
fout($mysql_id);
echo "<font size='+4' color='#1A1A1A'><div style='text-align: center'>$updb[$taal]</div></font><br /><br />";
?>
<form action="zoneupdate.php" method="post">
<table width="50%" align="center">
<?php
while ($row = mysql_fetch_row($res)) {
	//echo "0--$row[0]--1--$row[1]--2--$row[2]--id = $row[3]--//";
	echo "<tr><td><strong>$plaats[$taal]</strong><td><td><input type='text' name='plaats' value='$row[1]' size='25' />";
	echo "<tr><td><strong>$postcode[$taal]</strong><td><td><input type='text' name='zip' value='$row[2]' size='25' />";
	echo "<tr><td><strong>Km</strong><td><td><input type='text' name='km' value='$row[0]' size='25' />";
	echo "<tr><td colspan='2'><input type='hidden' name='nr' value='$row[3]'><input type='hidden' name='bank' value='$dtb'/>&nbsp;</td></tr>";
}
mysql_free_result($res);


?>

<tr><td colspan="2"><div style="text-align: center"><br /><input type="submit" value="<?php echo $updb[$taal];?>" name="doen" /></div></td>
</table>
</form>
<?php
}
?>